package com.ostrich.a2104shopping.ui.home;

import com.ostrich.a2104shopping.ui.home.entity.AddCarRequestEntity;
import com.ostrich.a2104shopping.ui.home.entity.CarEntity;
import com.ostrich.a2104shopping.ui.home.entity.CategoryEntity;
import com.ostrich.a2104shopping.ui.home.entity.GoodsDetailEntity;
import com.ostrich.a2104shopping.ui.home.entity.GoodsEntity;
import com.ostrich.a2104shopping.ui.home.entity.IdsRequestEntity;
import com.ostrich.lib_common.net.BaseResponseEntity;

import java.util.List;

import androidx.lifecycle.LiveData;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * @Author : yaotianxue
 * @Time : On 2023/10/6 09:02
 * @Description : HomeApi
 */
public interface HomeApi {
    //商品分类
    @GET("/goods/category")
    LiveData<BaseResponseEntity<List<CategoryEntity>>> category();
    //商品
    @GET("/goods/info")
    LiveData<BaseResponseEntity<List<GoodsEntity>>> info(@Query("category_id") int category_id,@Query("currentPage") int currentPage,@Query("pageSize") int pageSize);
    //商品详情
    @GET("/goods/detail")
    LiveData<BaseResponseEntity<GoodsDetailEntity>> detail(@Query("goods_id") int goods_id);
    //加入购物车
    @POST("/goods/addCar")
    LiveData<BaseResponseEntity> addCar(@Body AddCarRequestEntity requestEntity);

    //查看购物车
    @GET("/goods/selectCar")
    LiveData<BaseResponseEntity<List<CarEntity>>> selectCar();
    //删除购物车
    @POST("/goods/deleteCar")
    LiveData<BaseResponseEntity<String>> deleteCar(@Body IdsRequestEntity requestEntity);
}

